# COPYRIGHT_CHUNFENG
include config.mk
include libs.mk
OS ?= LINUX32
VER = $(shell cat VERSION)
CC ?= gcc
CFLAGS += -Wall
LDFLAGS += 
ifeq ($(DEBUG),y)
CFLAGS += -g
LDFLAGS += -g
else
CFLAGS += -s
LDFLAGS += -s -O2
endif

###########################################################
TARGET = test
CFLAGS += -I./include 
ifeq ($(OS),WIN32)
CFLAGS += -D_WIN32_
else
endif
LDFLAGS += $(LDFLAGS_LIBCHUNFENG)
ifeq ($(ENABLE_BLKID), yes)
CFLAGS += -D_ENABLE_BLKID_
endif
OBJS = test.o
###########################################################

all:$(TARGET)

$(TARGET):$(TARGET).$(VER)
ifeq ($(OS),WIN32)
	mv $^ $@
else
	ln -sf $^ $@
endif


$(TARGET).$(VER):$(OBJS)
	$(CC) $^ $(LDFLAGS) -o$@ 

	
install:
	mkdir -p $(INSTALL_DIR)/usr/lib
	cp -af ${TARGET} ${TARGET}.${VER} $(INSTALL_DIR)/usr/lib

	
uninstall:
	rm -rf $(INSTALL_DIR)/usr/lib/${TARGET} $(INSTALL_DIR)/usr/lib/${TARGET}.$(VER)

	
clean:
	rm -rf test $(TARGET)  $(TARGET).${VER} *.o

	
.PHONY : all clean install uninstall

